import { createStore } from 'vuex'  
  
const store = createStore({  
  state: {  
    count: 0,  
    items: []  
  },  
  mutations: {  
    increment (state) {  
      state.count++  
    },  
    addItem (state, item) {  
      state.items.push(item)  
    }  
  },  
  getters: {  
    count: state => state.count,  
    items: state => state.items  
  }  
})  
  
export default store